import { request, qs } from '../util/request';

export default {
  /**
   * 登录
   */
  login(params) {
    return request({
      method: 'POST',
      url: `http://micro.airtlab.com/api/user/login/`,
      data: qs(params),
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      }
    })
  },

  /**
   * 注册
   */
  register(params) {
    return request({
      method: 'POST',
      url: `http://micro.airtlab.com/api/user/register/`,
      data: qs(params),
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      }
    })
  },

  /**
   * 获取用户信息
   */
  getUserInfo() {
    return request({
      method: 'GET',
      url: `http://micro.airtlab.com/api/user/userInfo`,
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      }
    })
  },

  /**
   * 获取账户信息
   */
  getAssets() {
    return request({
      method: 'GET',
      url: `http://micro.airtlab.com/api/user/getUserAssets`,
    })
  }
}